package com.liangwj.springbootdesignpatterns.createTypePatterns.builder.demo_1;

public class BuilderPatternDemoTest {

    public static void main(String[] args) {
        FoodMealBuilder mealBuilder = new FoodMealBuilder();

        FoodMeal vegMeal = mealBuilder.prepareVegMeal();
        /*vegMeal.addItem(new Burger() {
            @Override
            public BigDecimal price() {
                return new BigDecimal(30);
            }

            @Override
            public String name() {
                return "牛肉汉堡";
            }
        });
        vegMeal.addItem(new FoodItems() {
            @Override
            public String name() {
                return "asdf";
            }

            @Override
            public FoodPacking packing() {
                return () -> "qwer";
            }

            @Override
            public BigDecimal price() {
                return new BigDecimal(111);
            }
        });*/
        System.out.println("Veg Meal:");
        vegMeal.showFoodItems();
        System.out.println("Total cost:" + vegMeal.getCost());
        System.out.println("=================================================");

        FoodMeal meatMeal = mealBuilder.prepareMeatMeal();
        System.out.println("Meat Meal:");
        meatMeal.showFoodItems();
        System.out.println("Total cost:" + meatMeal.getCost());
    }
}
